package day1206_1;
class  G   extends  Thread{
    C   t1;
    G(C cc){
        t1=cc;
    }
    public void run() {
        try {
            t1.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("吃饭");
    }
}










class  C   extends  Thread{
    public void run() {
        System.out.println("做饭");
        try {
            Thread.sleep(30000);//做饭需要30秒
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

public class T1 {
    public static void main(String[] args) {
        C   c1=new C();
        c1.start();
    }
}
